/*
 * @Author: LIFM0623 1944099171@qq.com
 * @Date: 2024-01-11 22:41:51
 * @LastEditors: LIFM0623 1944099171@qq.com
 * @LastEditTime: 2024-03-29 20:42:02
 * @FilePath: \Scene_Back\src\map-ease\entities\map-ease.entity.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {
  BeforeInsert,
  Column,
  Entity,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';
import { v4 as uuidv4 } from 'uuid';
@Entity()
export class mapEase {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  creator: string;

  @Column({ type: 'double precision' })
  lon: number

  @Column({ type: 'double precision' })
  lat: number

  @Column({
    name: 'create_time',
    type: 'timestamp without time zone',
    default: () => 'CURRENT_TIMESTAMP',
  })
  create_time: Date;

  @UpdateDateColumn({
    name: 'update_time',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
  })
  update_time: Date;

  @Column()
  start: number;

  @Column()
  finish: number;

  @Column({ type: 'double precision' })
  zoom: number;

  @Column({ type: 'double precision' })
  pitch: number;

  @Column({ type: 'double precision' })
  bearing: number;

  @BeforeInsert()
  addId() {
    this.id = uuidv4();
  }
}
